Skip to content

fix(server): long webhook prompts in the delivery log no longer end in a broken character - #40726

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
tiliakoos:fix/webhook-log-split-emoji
Nov 22, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
tiliakoos:fix/webhook-log-split-emoji

Conversation

@tiliakoos

Copy link
Copy Markdown
Contributor

Problem

A webhook delivery's prompt is stored in the delivery log cut at 65,536 UTF-16 code units. When an emoji straddles that limit, the log keeps only its high surrogate, which SQLite stores as U+FFFD, so Settings › Scheduled tasks › Deliveries shows the prompt ending in a replacement character the request never had.

Change

Both writes of rendered_prompt in ScheduledTaskService.ts (the direct delivery and the pending dispatch) now drop the high surrogate when the cut would split a pair, using the existing splitsSurrogatePair from @t3tools/shared/assistantCitations, the same way #40701 fixed setup script output. The prompt the agent receives is unchanged.

Scope

A small fix for an obvious bug, so no issue. It re-lands MarcoDotIO's #31750 (approved by Macroscope, closed by its author as "real but cosmetic"), credited with a Co-authored-by trailer, and is the same class of fix as #40701.

Verification

  • vp test run apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.ts: the new case "drops an emoji split by the delivery log's prompt limit" fails on main with expected 'aa\ufffd' to equal 'aaa' and passes with the fix; all 58 cases in the file pass.
  • vp run check:changed upstream/main: format, lint, knip, typecheck (3 packages) and tests (5 files, 99 tests) pass.
  • Scenario scripts/scenarios/webhook-log-keeps-whole-emoji.e2e.ts: creates a webhook task over RPC with the replay agent, posts a body whose emoji lands on the limit, and opens the delivery in Settings › Scheduled tasks. vp run scenarios:prove scripts/scenarios/webhook-log-keeps-whole-emoji.e2e.ts --base upstream/main exits 0:

Proven: the scenario fails on base ad1b1f9ca4 and passes on head fb1c5ff3b2.

Base ad1b1f9ca4 Head fb1c5ff3b2
Result ❌ failed
ASSERTION_FAILED: expect.not.toContainText failed
locator: getByRole("dialog") >> getByText(/^<webhook-data-/)
expected: not text containing "�"
observed: text "<webhook-data-07bb24b6264a>aaaa…aaaa�" (65,536 characters, shortened here)
✅ passed
logged prompt end Base ad1b1f9ca4: logged prompt end Head fb1c5ff3b2: logged prompt end
  • Not separately exercised: the pending-dispatch write (coalesced and held deliveries). It is the same expression on the same limit; the unit test and the scenario cover the direct delivery a user hits.

Claude Opus 5.5 via T3 Code

…n a broken character

The delivery log cut the rendered prompt at 65,536 UTF-16 code units, so an emoji on the limit was stored as half a surrogate pair and shown as U+FFFD. Both log writes now keep the whole character, as pingdotgg#40701 did for setup script output.

Co-authored-by: MarcoDotIO <20867620+MarcoDotIO@users.noreply.github.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Webhook delivery logs now truncate rendered prompts without splitting UTF-16 surrogate pairs. Unit and end-to-end tests cover a prompt with an emoji at the 64 KiB boundary.

Changes: Webhook prompt log

Layer / File(s) Summary
Safe prompt truncation
apps/server/src/scheduledTasks/ScheduledTaskService.ts, apps/server/src/scheduledTasks/ScheduledTaskService.webhook.test.ts
Both delivery recording paths shorten the prompt by one code unit when the 64 KiB limit splits a surrogate pair. A unit test checks the stored prompt length and content.
Delivery log end-to-end validation
scripts/scenarios/webhook-log-keeps-whole-emoji.e2e.ts
The scenario submits a prompt with an emoji across the 64 KiB boundary, opens the delivery log, and checks that the displayed prompt does not contain �.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#31750: Implements overlapping handling for surrogate-pair boundaries in webhook delivery-log prompt writes.
  • pingdotgg/t3code#26070: Fixes the same character-boundary problem for a different delivery-log field using streaming decode.

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, macroscopeapp

Merge Risk: Minimal · up to 2288b

Webhook delivery logs now avoid ending long prompts in a broken character. The agent prompt is unchanged, and the change is small and easy to revert. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: long webhook prompts in the delivery log no longer end in a broken character. It follows the conventional commit form, is one sentence, and matches the ScheduledTaskSe…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specifics. The problem names the bug, the surrogate split, and the affected U…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: long webhook prompts in the delivery log no longer end in a broken character. It follows the conventional commit form, is one sentence, and matches the ScheduledTaskService change that drops a high surrogate at the 64 KiB limit. It is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specifics. The problem names the bug, the surrogate split, and the affected UI. The change names both rendered_prompt writes and the shared helper. Scope explains why no issue is linked and credits the earlier PR. Verification gives focused unit test results, the check:changed run, and a scenario proof with before/after evidence. The agent-model line is present. Minor gaps: it does not link a tracked issue, and the template asks for one or a stated reason. It gives a reason, so this does not block a pass.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fb1c5ff and 2288b50.

Files selected for processing: 1

  • apps/server/src/scheduledTasks/ScheduledTaskService.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 22, 2026
juliusmarminge and others added 2 commits November 22, 2026 07:52
…-emoji

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Created an enabled replay webhook task with prompt {{body.text}}, POSTed 65,508 as followed by 😀 tail, then opened its delivery and scrolled the logged prompt to the end. The brief's 65,487 count was 21 characters short of the boundary. Real Chromium web client, fresh synthetic state, identical viewport and light theme on both commits.

Before After
11224f63d2 2288b50605
Before: prompt ends in replacement character After: prompt ends cleanly before emoji
Before recording After recording

Scenario script

The scenario failed on base with DOM tail aaaaaaa� and passed on head.

Not shown:

  • Complete prompt receipt by the agent was not inspected; this proof covers the delivery log.
  • The held-delivery write path was not exercised; the reproduction used an immediately accepted webhook.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 22, 2026
@juliusmarminge
juliusmarminge merged commit 02ea261 into pingdotgg:main Nov 22, 2026
54 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 22, 2026
@tiliakoos
tiliakoos deleted the fix/webhook-log-split-emoji branch November 22, 2026 08:23
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 22, 2026
**v0.1.12-nightly.20261122.5098** · 59 changes from 25 contributors

- **Issue activity links.** Open referenced issues and pull requests directly from an issue’s Activity list.
- **Linked project folders.** Browse linked folders when adding or opening a project.
- **TanStack Source pull requests.** Open TanStack Source pull requests from any client, including pull requests in private repositories.
- **Antigravity permissions.** Auto and Auto-accept edits no longer prompt for T3 Code’s own tools.
- **Project action drafts.** Clicking outside the action editor no longer discards your unsaved changes.
- **Script-only threads.** Return to a new thread’s script output and controls from the sidebar, even without sending a message.

### Plus 50 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(antigravity): pre-approve T3 MCP tools in Auto and Auto-accept edits by @charlesbine in pingdotgg/t3code#39822
* fix(server): Antigravity keeps Auto in the mode picker after a restart by @juliusmarminge in pingdotgg/t3code#40154
* fix(client-runtime): a new thread's first message and a queued send-now or steer survive a dropped socket by @Tgoh in pingdotgg/t3code#40703
* fix(server): long webhook prompts in the delivery log no longer end in a broken character by @tiliakoos in pingdotgg/t3code#40726
* fix(server): a released ACP session no longer leaves its run stuck running by @juliusmarminge in pingdotgg/t3code#40734
* feat(web): sidebar thread rows show the environment instead of the branch by @juliusmarminge in pingdotgg/t3code#40736
* fix: a failed checkpoint capture keeps Edit from here for conversation rewind by @juliusmarminge in pingdotgg/t3code#40745
* docs(claude): mobile shows the compact chip too by @juliusmarminge in pingdotgg/t3code#40755
* fix(server): TanStack Source pull requests open from every client, and private ones work end to end by @juliusmarminge in pingdotgg/t3code#40741
* fix: include delegated threads in CLI listing by @dajiaohuang in pingdotgg/t3code#40738
* fix(pi): turn token usage counts cached tokens as input and stays per turn by @juliusmarminge in pingdotgg/t3code#40758
* fix(mobile): usage account detail keeps even pace current while open by @juliusmarminge in pingdotgg/t3code#40759
* fix(server): Resume sends pending context to providers without native resume by @juliusmarminge in pingdotgg/t3code#40764
* fix(server): a failed or cancelled clone no longer blocks re-cloning its destination by @amanthanvi in pingdotgg/t3code#40739
* fix: retain pull request metadata in thread show by @dajiaohuang in pingdotgg/t3code#40744
* fix(web): show Queue for running sessions that cannot steer by @iiijiashu in pingdotgg/t3code#40767
* fix(web): a click outside the project action editor no longer discards the draft by @AymanKhan9 in pingdotgg/t3code#40776
* fix(server): t3 pair skips Windows VirtualBox and VMware host-only adapters by @juliusmarminge in pingdotgg/t3code#33441
* fix(server): Word text boxes keep their paragraph breaks for agents by @KyrosHendrix in pingdotgg/t3code#40782
* fix(web): RTF previews respect hidden character formatting by @geezoria in pingdotgg/t3code#40783
* fix(mobile): the iOS composer keeps its keyboard and caret after dictation by @arun279 in pingdotgg/t3code#33916
* fix(shared): find file links whose labels contain brackets by @Abhiram-745 in pingdotgg/t3code#40781
* fix(web): restore effort picker keyboard typeahead by @juliusmarminge in pingdotgg/t3code#40798
* fix(server): migration 75 no longer fails on an unreadable subagent payload by @juliusmarminge in pingdotgg/t3code#30783
* fix(issues): an Activity cross-reference opens the issue or pull request it came from by @juliusmarminge in pingdotgg/t3code#40768
* fix(server): tell a stopped parent which delegated tasks its Stop interrupted by @juliusmarminge in pingdotgg/t3code#34499
* fix(server): worktree thread lookups match any spelling of the path by @juliusmarminge in pingdotgg/t3code#36802
* fix(mobile): prevent clipped percentages in usage limit cards by @peterxiemin in pingdotgg/t3code#40778
* test(web): browser tests no longer fail when a stale optimizer cache reloads them mid-run by @Brechard in pingdotgg/t3code#31999
* fix(github): superseded runs' cancelled checks no longer block PR watches by @juliusmarminge in pingdotgg/t3code#30434
* fix(web): keybindings using '+' show a plus keycap instead of empty pills by @AymanKhan9 in pingdotgg/t3code#40808
* fix(web): lineage show-more no longer clips the last row or drops focus by @justsrc in pingdotgg/t3code#31295
* fix(mobile): pulling to Load earlier activity no longer snaps the feed back to the end by @juliusmarminge in pingdotgg/t3code#31907
* perf(dev): incremental, cached server typecheck like web and desktop (body edit 10.3 s → 5.4 s) by @Pyseph in pingdotgg/t3code#30879
* fix(contracts): delegate_task options example says ids differ by provider by @juliusmarminge in pingdotgg/t3code#40806
* fix(web): preserve reply-only edits when a queued message leaves the queue by @iiijiashu in pingdotgg/t3code#40763
* fix(server): t3 start ignores a stale runtime record whose PID was reused by @juliusmarminge in pingdotgg/t3code#28256
* fix(server): runtime prune removes the runtime a committed update replaced and abandoned staging by @juliusmarminge in pingdotgg/t3code#40817
* fix(server): preserve cancellations during checkpoint capture by @voltcrash in pingdotgg/t3code#31349
* fix(web): a failed main chunk load reloads once instead of showing the boot error by @juliusmarminge in pingdotgg/t3code#26451
* fix(server): slash commands reach the provider verbatim when context is pending by @juliusmarminge in pingdotgg/t3code#30261
* fix(opencode): a command that never calls the model no longer leaves the turn running by @juliusmarminge in pingdotgg/t3code#27378
* fix(mobile): model search finds legacy models by @juliusmarminge in pingdotgg/t3code#27587
* fix(acp): follow a mode the agent leaves on its own so picking it again applies by @juliusmarminge in pingdotgg/t3code#40818
* fix(web): settling a thread no longer jolts the sidebar list by @flamboh in pingdotgg/t3code#26661
* fix(server): Word files whose main part is not word/document.xml reach the agent by @Marve10s in pingdotgg/t3code#40777
* fix(server): wake the agent when Claude exits while it awaits background work by @juliusmarminge in pingdotgg/t3code#30214
* fix(web): Usage Limits no longer shows a stale scrollbar by @inanimran in pingdotgg/t3code#40816
* fix(web): closing the last open pull request clears it from the list by @MyDigitalLife in pingdotgg/t3code#29438
* fix(mobile): account badge on the provider icon is readable without an accent color by @juliusmarminge in pingdotgg/t3code#40837
* fix(server): Claude turns no longer stall on empty or partial stream usage frames by @lln556 in pingdotgg/t3code#40804
* fix(server): filesystem browse lists symlinks pointing to directories by @lln556 in pingdotgg/t3code#40830
* fix(client-runtime): a resumed thread renders its catch-up once instead of stepping through stale states by @ahalekelly in pingdotgg/t3code#27401
* fix(web): clicking the Tab hint inserts short prompt suggestions again by @floklein in pingdotgg/t3code#40841
* fix(web): keep script-only drafts reachable in the sidebar by @juliusmarminge in pingdotgg/t3code#25272
* fix(server): retire unresponsive shared Codex app-servers by @juliusmarminge in pingdotgg/t3code#25123
* fix(shared): Windows command discovery no longer blocks the event loop by @maria-rcks in pingdotgg/t3code#27391
* fix(client-runtime): stop sessions on incompatible server configuration by @juliusmarminge in pingdotgg/t3code#21667
* fix(web): browser page translation no longer crashes the app when a turn updates by @juliusmarminge in pingdotgg/t3code#40856

## New Contributors
* @amanthanvi made their first contribution in pingdotgg/t3code#40739
* @iiijiashu made their first contribution in pingdotgg/t3code#40767
* @KyrosHendrix made their first contribution in pingdotgg/t3code#40782
* @Abhiram-745 made their first contribution in pingdotgg/t3code#40781
* @peterxiemin made their first contribution in pingdotgg/t3code#40778
* @inanimran made their first contribution in pingdotgg/t3code#40816
* @MyDigitalLife made their first contribution in pingdotgg/t3code#29438
* @lln556 made their first contribution in pingdotgg/t3code#40804

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261122.5085...v0.1.12-nightly.20261122.5098

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261122.5098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants